﻿@model IEnumerable<Movies.Web.Movie>

@{
    ViewBag.Title = "Index";
}

<h2>Index</h2>
<span>
    @TempData["errorMessage"]
</span>
<p>
    @Html.ActionLink("Create New", "Create")
</p>
<table>
    <tr>
        <th>Actions</th>
        <th>
            Name
        </th>
        <th>
            Relase Date
        </th>
        <th>
            Rating
        </th>
    </tr>

@foreach (var item in Model) {
    <tr>
        <td>
            @Html.ActionLink("Edit", "Edit", new {  id=item.Id  }) |
            @Html.ActionLink("Details", "Details", new {  id=item.Id}) |
            @Html.ActionLink("Delete", "Delete", new {  id=item.Id })
        </td>
        <td>
            @item.Name
        </td>
        <td>
            @String.Format("{0:g}", item.RelaseDate.Value.ToShortDateString())
        </td>
        <td>
            @item.Rating
        </td>
    </tr>
}

</table>

